package com.xbongbong.saas.service;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.distributor.dto.DistributorContactDeleteBatchDTO;
import com.xbongbong.distributor.dto.DistributorContactEditAttrUpdateDTO;
import com.xbongbong.distributor.dto.DistributorContactUpdateBatchDTO;
import com.xbongbong.distributor.vo.DistributorContactDeleteBatchVO;
import com.xbongbong.distributor.vo.DistributorContactUpdateBatchVO;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.pojo.dto.FormDataListDTO;
import com.xbongbong.paas.pojo.dto.SaasFormSaveDTO;
import com.xbongbong.paas.pojo.dto.ValidateDataDTO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.applist.pojo.vo.ListAppVO;
import com.xbongbong.pro.businessdata.pojo.dto.FormatExplainDTO;
import com.xbongbong.pro.contact.pojo.dto.ContactDeleteBatchDTO;
import com.xbongbong.pro.contact.pojo.vo.ContactDeleteBatchVO;
import com.xbongbong.pro.contact.pojo.vo.ContactUpdateBatchVO;
import com.xbongbong.pro.formdata.pojo.dto.SaasAnalysisDataDTO;
import com.xbongbong.pro.formexplain.pojo.dto.HandlerExplainInLinkItemDTO;

import java.util.List;

/**
 * @author mengna.deng
 */
public interface DistributorContactService {

    /**
     * 格式化解释字段
     * @param formatExplainDTO
     * @throws XbbException
     * @author xinpeng.jiang
     * @date 2020/12/22 16:13
     * @version 1.0
     */
    void formatAddExplain(FormatExplainDTO formatExplainDTO) throws XbbException;
    /**
     * 经销商保存前saas特殊校验
     *
     * @param validateDataDTO saas特殊校验数据入参
     * @throws XbbException 业务异常
     * @author feng.zheng
     * @date 2019/1/18
     */
    void beforeSave(ValidateDataDTO validateDataDTO) throws XbbException;

    void afterSave(SaasFormSaveDTO saasFormSaveDTO) throws XbbException;

    /**
     * 批量更新某个字段
     * @param distributorContactEditAttrUpdateDTO
     * @throws XbbException
     */
    void batchEditAttr(DistributorContactEditAttrUpdateDTO distributorContactEditAttrUpdateDTO) throws XbbException;

    /**
     * 更新客户名称
     * @author 吴峰
     * @date 15:42 2019/2/15
     * @desrcption
     * @param distributorContactUpdateBatchDTO 客户名称更新入参
     * @return void
     * @throws XbbException 业务异常
     */
    DistributorContactUpdateBatchVO updateBatch(DistributorContactUpdateBatchDTO distributorContactUpdateBatchDTO) throws XbbException;

    /**
     * 批量删除
     * @author 吴峰
     * @date 2019/3/10 15:55
     * @param distributorContactDeleteBatchDTO
     * @return com.xbongbong.pro.contact.pojo.vo.ContactDeleteBatchVO
     * @throws XbbException 业务异常
     */
    DistributorContactDeleteBatchVO deleteBatch(DistributorContactDeleteBatchDTO distributorContactDeleteBatchDTO) throws XbbException;

    /**
     * 更新失败回滚
     * @param idIn
     * @param corpid
     * @throws XbbException
     * @author xinpeng.jiang
     * @date 2021/1/5 19:18
     * @version 1.0
     */
    void updateRollback(List<Long> idIn, String corpid) throws XbbException;

    /**
     * 移动端联系人列表转换
     * @param formDataListDTO
     * @param esEntities
     * @param totalCount
     * @return
     */
    ListAppVO formatContactAppList(FormDataListDTO formDataListDTO, List<PaasFormDataEntityExt> esEntities, Integer totalCount) throws XbbException;

    /**
     * 关联新建时格式化解释
     *
     * @param handlerExplainInLinkItemDTO 入参
     * @throws XbbException 异常
     * @author feng.zheng
     * @date 2019-03-16 20:53
     */
    void formatLinkAddExplain(HandlerExplainInLinkItemDTO handlerExplainInLinkItemDTO) throws XbbException;
}
